/* 题库页面样式 */

/* 账户关联提示样式 */
.account-notice {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 1px solid #ffc107;
    border-left: 4px solid #f39c12;
    color: #856404;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0 2rem 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.15);
    transition: all 0.3s ease;
}

.account-notice:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.25);
}

.account-notice i {
    font-size: 1.25rem;
    color: #f39c12;
    flex-shrink: 0;
}

.account-notice span {
    font-size: 0.95rem;
    line-height: 1.4;
}

.account-notice strong {
    font-weight: 600;
    color: #d68910;
}

/* 深色主题下的账户提示样式 */
body.dark-theme .account-notice {
    background: linear-gradient(135deg, #2d3748, #4a5568);
    border-color: #f6e05e;
    border-left-color: #ecc94b;
    color: #f7fafc;
}

body.dark-theme .account-notice i {
    color: #ecc94b;
}

body.dark-theme .account-notice strong {
    color: #f6e05e;
}

/* 题库分类侧边栏 */
.tutorial-sidebar .quiz-stats {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--color-border);
}

.quiz-stats h3 {
    margin-bottom: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--color-border);
}

.stat-label {
    font-weight: 500;
    color: var(--color-text-light);
}

.stat-value {
    font-weight: 600;
    color: var(--color-primary);
    transition: all 0.3s ease;
}

.stat-value.completed {
    color: var(--color-success);
    font-weight: 700;
}

/* 题目样式 */
.quiz-category {
    margin-bottom: 2rem;
}

.quiz-list {
    margin-top: 1.5rem;
    gap: 1.5rem;
}

.quiz-item {
    background-color: var(--color-light);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quiz-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.quiz-question {
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.question-number {
    display: inline-block;
    width: 28px;
    height: 28px;
    background-color: var(--color-primary);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    margin-right: 8px;
    font-size: 0.9rem;
}

/* 选项样式 */
.quiz-options {
    margin-bottom: 1.5rem;
}

.option {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.option:hover {
    background-color: rgba(80, 116, 151, 0.1);
}

.option input[type="radio"] {
    margin-right: 0.75rem;
    cursor: pointer;
}

/* 填空题样式 */
.quiz-input {
    margin-bottom: 1.5rem;
}

.quiz-input input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: var(--font-mono);
}

.quiz-input input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(80, 116, 151, 0.2);
}

/* 解析样式 */
.quiz-explanation {
    margin-top: 1rem;
    padding: 1rem;
    background-color: rgba(80, 116, 151, 0.1);
    border-left: 4px solid var(--color-primary);
    border-radius: 0 4px 4px 0;
}

.quiz-explanation strong {
    color: var(--color-primary);
}

/* 按钮样式 */
.quiz-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* 隐藏元素 */
.hidden {
    display: none;
}

/* 答题状态样式 */
.quiz-item.answered {
    border-color: var(--color-primary);
}

.quiz-item.correct {
    background-color: rgba(72, 187, 120, 0.1);
    border-left: 4px solid var(--color-success);
}

.quiz-item.incorrect {
    background-color: rgba(245, 101, 101, 0.1);
    border-left: 4px solid var(--color-error);
}

/* 分部分提交相关样式 */
.quiz-section {
    margin-bottom: 3rem;
}

.section-submit {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--color-border);
    text-align: center;
}

.submit-section {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.submit-section:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(80, 116, 151, 0.3);
}

.submit-section:disabled,
.submit-section.submitted {
    background: var(--color-border);
    color: var(--color-text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 部分结果显示样式 */
.section-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 8px;
    background: var(--color-light);
    border: 1px solid var(--color-border);
}

.section-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.score-text {
    font-size: 1.1rem;
    font-weight: 600;
}

.score-percentage {
    font-size: 2rem;
    font-weight: 700;
}

.score-level {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.result-excellent {
    color: var(--color-success);
}

.result-good {
    color: #f59e0b;
}

.result-poor {
    color: var(--color-error);
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .tutorial-container {
        flex-direction: column;
        padding: 0 0.5rem;
    }

    .tutorial-sidebar {
        position: static;
        margin-bottom: 2rem;
        width: 100%;
        overflow-x: hidden;
    }

    .quiz-item {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .quiz-question {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .ai-assistant-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .quiz-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .quiz-actions button {
        width: 100%;
    }

    .submit-section {
        width: 100%;
        min-width: auto;
        padding: 0.8rem 1.5rem;
    }

    .section-score {
        padding: 1rem;
    }

    .score-percentage {
        font-size: 1.5rem;
    }

    /* 优化选项在移动端的显示 */
    .option {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .quiz-input input {
        font-size: 16px; /* 防止iOS缩放 */
    }
}

/* 深色主题适配 */
body.dark-theme .quiz-item {
    background-color: #2d3748;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

body.dark-theme .option:hover {
    background-color: rgba(80, 116, 151, 0.2);
}

body.dark-theme .quiz-explanation {
    background-color: rgba(80, 116, 151, 0.2);
    color: var(--color-text);
}

body.dark-theme .quiz-explanation p {
    color: var(--color-text);
}

body.dark-theme .quiz-explanation strong {
    color: var(--color-text);
}

body.dark-theme .stat-label {
    color: var(--color-text-light);
}

body.dark-theme .stat-value {
    color: var(--color-secondary);
}

body.dark-theme .quiz-input input {
    background-color: #4a5568;
    border-color: #4a5568;
    color: var(--color-text);
}

body.dark-theme .quiz-input input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(80, 116, 151, 0.3);
}

body.dark-theme .section-result {
    background-color: #2d3748;
    border-color: #4a5568;
}

body.dark-theme .submit-section:disabled,
body.dark-theme .submit-section.submitted {
    background-color: #4a5568;
    color: #a0aec0;
}

/* 清空答题记录按钮样式 */
.clear-data-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-top: 1.5rem;
    background-color: var(--color-error);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.clear-data-btn:hover {
    background-color: #e53e3e;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.2);
}

.clear-data-btn:active {
    transform: translateY(0);
}

/* 深色主题下的清空按钮样式 */
body.dark-theme .clear-data-btn {
    background-color: #e53e3e;
}

body.dark-theme .clear-data-btn:hover {
    background-color: #c53030;
    box-shadow: 0 4px 8px rgba(229, 62, 62, 0.3);
}

/* AI助手按钮样式 */
.ai-assistant-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin-left: 1rem;
    background: linear-gradient(135deg, #8B5CF6, #A855F7);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.2);
    position: relative;
    overflow: hidden;
}

.ai-assistant-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    background: linear-gradient(135deg, #7C3AED, #9333EA);
}

.ai-assistant-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.2);
}

.ai-assistant-btn i {
    font-size: 0.875rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* 深色主题下的AI助手按钮样式 */
body.dark-theme .ai-assistant-btn {
    background: linear-gradient(135deg, #6D28D9, #7C3AED);
    box-shadow: 0 2px 4px rgba(109, 40, 217, 0.3);
}

body.dark-theme .ai-assistant-btn:hover {
    background: linear-gradient(135deg, #5B21B6, #6D28D9);
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.4);
}

/* 题目标题区域样式调整 */
.quiz-question {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quiz-question .question-number {
    flex-shrink: 0;
}

.quiz-question .question-text {
    flex: 1;
    margin-right: auto;
}

.quiz-question .ai-assistant-btn {
    margin-left: auto;
}

/* 黑夜模式样式已移动到 js/main2.js 的动态样式中 */

/* 响应式设计 */
@media (max-width: 768px) {
    .ai-assistant-btn {
        margin-left: 0;
        margin-top: 0.5rem;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .quiz-question {
        flex-direction: column;
        align-items: flex-start;
    }
}